//
// Created by cube on 2020/8/3.
//

#ifndef COMPILERDOMEA1_LOGSYSTEM_H
#define COMPILERDOMEA1_LOGSYSTEM_H

#include "../Base/Object.h"

namespace Lib{
    class LogSystem : public Object{
    public:
        LIB_OBJECT
        LIB_SIGNAL(error,std::string)
        LIB_SIGNAL(massage,std::string)

    public:
        void error(char* msg){
            std::string msgstr = "Error :> file:< ";
            msgstr += msg;
            emit(static_cast<const uint8_t>(SignalType::error),msgstr);
        }

        void massage(std::string msg){
            std::string msgstr = "Massage :> ";
//        msgstr += __FILE__;
//        msgstr += " > function: <";
//        msgstr += __FUNCTION__;
//        msgstr += " > msg :> ";
            msgstr += msg;
            emit(static_cast<const uint8_t>(SignalType::error),msgstr);
        }
    };
}

#endif //COMPILERDOMEA1_LOGSYSTEM_H
